package com.study.SpringBootLesson4.springboot.servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Writer;

/**
 * @author 赵超
 * @Description springbootApi方式
 * @create 2017-11-29 15:40
 **/
public class MyServlet2 extends HttpServlet {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        Writer writer = response.getWriter();

        ServletContext servletContext = request.getServletContext();
        servletContext.log("server doGet2");

        writer.write("<html><body>Hello from server2 , Fuck!</body></html>");

    }

}
